package com.chilly.db1.service;

import com.chilly.bean.User;
import com.chilly.db1.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Chilly Cui on 2020/11/13.
 */
@Transactional(rollbackFor = {Exception.class})
@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    /**
     * 根据名字查找用户
     */
    @Transactional(rollbackFor = RuntimeException.class)
    public User selectUserByName(String name) {
        return userDao.findUserByName(name);
    }

}